<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta content="always" name="referrer">
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>发布需求</title>
    <link rel="stylesheet" href="/LianniuWeb/css/new/reset.css">
    <link rel="stylesheet" href="/LianniuWeb/css/new/build/css/layui.css"  media="all">
    <link rel="stylesheet" href="/LianniuWeb/css/new//webuploader.css" />
    <link rel="stylesheet" href="/LianniuWeb/css/new/post_demand.css">
    <link rel="stylesheet" href="/LianniuWeb/css/new/build/css/layui.css"  media="all">
    <link type="text/css" rel="stylesheet" href="/LianniuWeb/css/easydialog.css"/>
    <link type="text/css" rel="stylesheet" href="/LianniuWeb/css/jquery-ui.css"/>
    <link type="text/css" rel="stylesheet" href="/LianniuWeb/css/jquery.datetimepicker.css"/>
    <script type="text/javascript" src="/LianniuWeb/js/widget/easydialog.min.js"></script>
</head>
<body>
<div class="ranking_header">
    <div class="back_btn" onclick="window.location.href='/LianniuWeb/buyer/demand/source.do'"></div>
    <p>发布需求</p>
</div>
<form class="layui-form">
    <div class="padding_both">
        <div class="password_box" style="margin-top: 20px;">
            <span>有效期限：</span>
            <input type="text" name="deadline" placeholder="请选择有效期限" id="deadline">
        </div>
        <div class="password_box">
            <span>购买要求：</span>
            <div class="check_box">
                <div class="" style="margin-bottom: 0.2rem">
                    <input type="checkbox"  lay-skin="primary" title="检疫文件"  lay-filter="isrequirefile">
                    <input type="hidden" name="isrequirefile" id="isrequirefile" value="0">
                    <input type="checkbox" lay-skin="primary" title="照片" lay-filter="isrequireimg">
                    <input type="hidden" name="isrequireimg" id="isrequireimg" value="0">
                </div>
                <div class="">
                    <input type="checkbox" lay-skin="primary" title="注册牛" lay-filter="isregister">
                    <input type="hidden"  name="isregister" id="isregister" value="0">
                    <input type="checkbox"  lay-skin="primary" title="产子" lay-filter="ischild">
                    <input type="hidden" value="0" name="ischild" id="ischild" >
                </div>
            </div>
        </div>
        <div class="password_box">
            <span>总数量：</span>
            <input type="text" name="amount" placeholder="请输入" id="amount" maxlength="10">
        </div>
        <div class="select_box">
            <span>一级分类：</span>
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <select id="parentId1" lay-filter="parentId">
                        <option value="">请选择</option>
                    </select>
                    <input type="hidden" id="parentId" name="cateidfirst">
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="select_box">
            <span>二级分类：</span>
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <select id="cateId1" lay-filter="cateId">
                        <option value="">请选择</option>
                    </select>
                    <input type="hidden" id="cateId" name="cateidseconde" value=""/>
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="password_box">
            <span>产品名称：</span>
            <input type="text" name="productname" placeholder="请输入" id="productname" maxlength="20">
        </div>
        <div class="select_box">
            <span>类别：</span>
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <select id="specId1" lay-filter="specId">
                        <option value="">请选择</option>
                    </select>
                    <input type="hidden" id="specId" name="categoryid" value="">
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="password_box">
            <span>价格区间：</span>
            <div class="section">
                <div class="layui-input-inline">
                    <input type="text" name="minprice" placeholder="最低价" autocomplete="off" class="layui-input" id="minprice" maxlength="10">
                </div>
                <div class="mid_arrow">-</div>
                <div class="layui-input-inline">
                    <input type="text" name="maxprice" placeholder="最高价" autocomplete="off" class="layui-input" id="maxprice" maxlength="10">
                </div>
            </div>
        </div>
        <div class="select_box">
            <span>收货省：</span>
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <select id="consProvince1" lay-filter="consProvince">
                        <option value="">请选择</option>
                    </select>
                    <input type="hidden" id="consProvince" value="">
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="select_box">
            <span>收货市：</span>
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <select id="consCity1" lay-filter="consCity">
                        <option value="">请选择</option>
                    </select>
                    <input type="hidden" id="consCity" value="">
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="select_box">
            <span>收货县：</span>
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <select id="consCountry1" lay-filter="consCountry">
                        <option value="">请选择</option>
                    </select>
                    <input type="hidden" id="consCountry" value="">
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="password_box">
            <span>收货详址：</span>
            <input type="text" name="deliveryaddress" placeholder="请输入" id="address" maxlength="20">
        </div>
        <input type="button" value="提交" class="load_btn" id="btn">
    </div>
</form>
<script src="/LianniuWeb/js/underscore/underscore.js"></script>
<script src="/LianniuWeb/js/commons/commons.js"></script>
<script src="/LianniuWeb/js/commons/util.js"></script>
<script src="/LianniuWeb/js/jquery/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="/LianniuWeb/js/buyer/flexible.js"></script>
<script type="text/javascript" src="/LianniuWeb/js/demand/publishDemand.js"></script>
<script src="/LianniuWeb/css/new/build/layui.js" charset="utf-8"></script>
<script src="/LianniuWeb/js/buyer/webuploader.js"></script>
<script src="/LianniuWeb/js/jquery/jquery.datetimepicker.js"></script>
<script type="text/javascript">

    // 初始化Web Uploader
    var uploader = WebUploader.create({

        // 选完文件后，是否自动上传。
        auto: true,
        // swf文件路径
        swf: '/js/Uploader.swf',

        // 文件接收服务端。
        server: '/LianniuWeb/rest/fileUpload/uploadPic.do?filepath=publishDemand',

        // 选择文件的按钮。可选。
        // 内部根据当前运行是创建，可能是input元素，也可能是flash.
        pick: {id:'#filePicker',multiple:false},
        compress:{
            width: 500,
            height: 550,

            // 图片质量，只有type为`image/jpeg`的时候才有效。
            quality: 40,

            // 是否允许放大，如果想要生成小图的时候不失真，此选项应该设置为false.
            allowMagnify: false,

            // 是否允许裁剪。
            crop: false,

            // 如果发现压缩后文件大小比原来还大，则使用原来图片
            // 此属性可能会影响图片自动纠正功能
            noCompressIfLarger: false,

            // 单位字节，如果图片大小小于此值，不会采用压缩。
            compressSize: 30 * 1024
        },
        // 只允许选择图片文件。
        accept: {
            title: 'Images',
            extensions: 'gif,jpg,jpeg,bmp,png',
            mimeTypes: 'image/*'
        }
    });
    uploader.on( 'uploadSuccess', function( file,a,b ) {
        console.log("aaa")
        if($("#cardFront").attr("src") == "")
        {
            $("#cardFront").parent().show();
            $("#cardFront").attr("src", a.data);
            if($("#cardFront").attr("src") != ""
                    && $("#cardBack").attr("src") != "")
            {
                $("#filePicker").hide();
            }
            return;
        }
        if($("#cardBack").attr("src") == "")
        {
            $("#cardBack").parent().show();
            $("#cardBack").attr("src", a.data);
            if($("#cardFront").attr("src") != ""
                    && $("#cardBack").attr("src") != "")
            {
                $("#filePicker").hide();
            }
        }
    });

    uploader.on( 'uploadError', function( file ) {
        easyAlert("上传出错");
    });
</script>
<script>
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?867c800f411683d2a7fa9eb1eabd9736";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
</body>
</html>